<template>
  <transition name="el-fade-in">
    <el-dialog  title="提示"
                :visible.sync="dialogVisible"
                :width="dialogWidth"
                :before-close="handleClose">
      <slot></slot>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </transition>
</template>

<script>
export default {
    props: {
        dialogVisible: {
            type: Boolean,
            default: true  
        },
        dialogWidth:{
            type:String,
            default:'400px'
        },

        // that: { type: Object, default: this },
        // modalCfg: {
        //     visible: false,
        //     title: "",
        //     handles: []
        // },
        // width: {
        //     type: String,
        //     default: "50%"
        // },
        // isHeader: {
        //     type: Boolean,
        //     default: true
        // },
        // modalLoading: {
        //     type: Boolean,
        //     default: false
        // },
        // isHandle: {
        //     type: Boolean,
        //     default: true
        // }
    },
    computed: {},
    methods: {
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            console.log(_)
            done();
          })
          .catch(_ => {console.log(_)});
      }
    }
};
</script>